* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #242424 url("/assets/prove-your-rank-background.png") center / cover no-repeat;
  color: #1f2937;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle at 9% 18%, #fff8dc 0 1px, #ffb449 3px, transparent 11px),
    radial-gradient(circle at 28% 29%, #fff3bb 0 2px, #ff8b29 4px, transparent 10px),
    radial-gradient(circle at 77% 13%, #fff8dc 0 1px, #ffb449 3px, transparent 9px),
    radial-gradient(circle at 94% 31%, #fff3bb 0 2px, #ff8b29 4px, transparent 11px),
    radial-gradient(circle at 12% 61%, #fff8dc 0 1px, #ffb449 3px, transparent 9px),
    radial-gradient(circle at 37% 80%, #fff3bb 0 2px, #ff8b29 4px, transparent 10px),
    radial-gradient(circle at 63% 73%, #fff8dc 0 1px, #ffb449 3px, transparent 9px),
    radial-gradient(circle at 89% 87%, #fff3bb 0 2px, #ff8b29 4px, transparent 11px);
  animation: ember-twinkle 3.4s ease-in-out infinite alternate;
}

body::after {
  background-image:
    radial-gradient(circle at 18% 43%, #fff8dc 0 1px, #ff9c32 3px, transparent 8px),
    radial-gradient(circle at 36% 12%, #fff3bb 0 2px, #ffb449 4px, transparent 10px),
    radial-gradient(circle at 57% 23%, #fff8dc 0 1px, #ff9c32 3px, transparent 9px),
    radial-gradient(circle at 84% 51%, #fff3bb 0 2px, #ffb449 4px, transparent 10px),
    radial-gradient(circle at 6% 85%, #fff8dc 0 1px, #ff9c32 3px, transparent 8px),
    radial-gradient(circle at 43% 65%, #fff3bb 0 2px, #ffb449 4px, transparent 10px),
    radial-gradient(circle at 74% 88%, #fff8dc 0 1px, #ff9c32 3px, transparent 9px),
    radial-gradient(circle at 96% 69%, #fff3bb 0 2px, #ffb449 4px, transparent 10px);
  animation: ember-twinkle 4.7s -2s ease-in-out infinite alternate-reverse;
}

@keyframes ember-twinkle {
  from { opacity: .35; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(-5px); }
}

.login-page {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px 2cm;
}

.login-page::before,
.login-page::after {
  --fire-rise: min(10cm, 55svh);
  content: "";
  position: fixed;
  bottom: 6px;
  z-index: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7fd 0 2px, #ff56cf 3px, #ff00aa 100%);
  filter: drop-shadow(0 0 8px #ff00aa) drop-shadow(0 0 16px #ff00aa);
  pointer-events: none;
  opacity: 0;
  animation: pink-firecracker 6s linear infinite;
}

.login-page::before {
  left: 5.5vw;
  --fire-drift: 2.5cm;
  --fire-quarter-drift: .16cm;
  --fire-half-drift: .63cm;
  --fire-three-quarter-drift: 1.41cm;
}
.login-page::after {
  right: 5.5vw;
  --fire-drift: -2.5cm;
  --fire-quarter-drift: -.16cm;
  --fire-half-drift: -.63cm;
  --fire-three-quarter-drift: -1.41cm;
  animation-delay: 3s;
}

@keyframes pink-firecracker {
  0%, 3%, 100% {
    opacity: 0;
    transform: translate(0, 0);
    box-shadow: 0 0 0 transparent;
  }
  5% {
    opacity: 1;
    transform: translate(0, 0);
    box-shadow: 0 0 15px 7px #ff00aa;
  }
  10% {
    opacity: 1;
    transform: translate(var(--fire-quarter-drift), calc(-.25 * var(--fire-rise)));
  }
  15% {
    opacity: 1;
    transform: translate(var(--fire-half-drift), calc(-.5 * var(--fire-rise)));
  }
  20% {
    opacity: 1;
    transform: translate(var(--fire-three-quarter-drift), calc(-.75 * var(--fire-rise)));
  }
  25% {
    opacity: 1;
    background: radial-gradient(circle, #fff7fd 0 2px, #ff56cf 3px, #ff00aa 100%);
    transform: translate(var(--fire-drift), calc(-1 * var(--fire-rise)));
    box-shadow: 0 0 20px 9px #ff00aa;
  }
  25.01% {
    opacity: 1;
    background: transparent;
    transform: translate(var(--fire-drift), calc(-1 * var(--fire-rise)));
    box-shadow:
      0 0 2px 2px #fff0fb, 0 0 2px 2px #ff31c0,
      0 0 2px 2px #ff72d7, 0 0 2px 2px #fff0fb,
      0 0 2px 2px #ff31c0, 0 0 2px 2px #ff72d7,
      0 0 2px 2px #fff0fb, 0 0 2px 2px #ff31c0,
      0 0 2px 2px #ff72d7, 0 0 2px 2px #fff0fb,
      0 0 2px 2px #ff31c0, 0 0 2px 2px #ff72d7;
  }
  30.83% {
    opacity: 1;
    background: transparent;
    transform: translate(var(--fire-drift), calc(-1 * var(--fire-rise)));
    box-shadow:
      0 -3.5cm 3px 2px #fff0fb, 1.75cm -3.03cm 3px 2px #ff31c0,
      3.03cm -1.75cm 3px 2px #ff72d7, 3.5cm 0 3px 2px #fff0fb,
      3.03cm 1.75cm 3px 2px #ff31c0, 1.75cm 3.03cm 3px 2px #ff72d7,
      0 3.5cm 3px 2px #fff0fb, -1.75cm 3.03cm 3px 2px #ff31c0,
      -3.03cm 1.75cm 3px 2px #ff72d7, -3.5cm 0 3px 2px #fff0fb,
      -3.03cm -1.75cm 3px 2px #ff31c0, -1.75cm -3.03cm 3px 2px #ff72d7;
  }
  60% {
    opacity: 0;
    background: transparent;
    transform: translate(var(--fire-drift), calc(-1 * var(--fire-rise)));
    box-shadow:
      0 -3.5cm 4px 1px transparent, 1.75cm -3.03cm 4px 1px transparent,
      3.03cm -1.75cm 4px 1px transparent, 3.5cm 0 4px 1px transparent,
      3.03cm 1.75cm 4px 1px transparent, 1.75cm 3.03cm 4px 1px transparent,
      0 3.5cm 4px 1px transparent, -1.75cm 3.03cm 4px 1px transparent,
      -3.03cm 1.75cm 4px 1px transparent, -3.5cm 0 4px 1px transparent,
      -3.03cm -1.75cm 4px 1px transparent, -1.75cm -3.03cm 4px 1px transparent;
  }
}

.login-box {
  display: contents;
}

.google-signin-button {
  width: 9cm;
  height: 2.5cm;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 3px solid #023e8a;
  border-radius: 22px;
  background: #023e8a;
  color: #ffffff;
  font-size: 28px;
  font-weight: 600;
  line-height: .88;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(2, 62, 138, 0.35);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.google-signin-button:hover {
  border-color: #ffffff;
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 16px 32px rgba(2, 62, 138, 0.55);
}

.google-signin-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.google-mark {
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 800;
}

.legal-links {
  position: fixed;
  right: 16px;
  bottom: 12px;
  z-index: 2;
  margin: 0;
  color: #ffffff;
  font-size: 0.8rem;
  text-align: right;
}

.legal-links a {
  color: #ffffff;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after { animation: none; }
  .login-page::before,
  .login-page::after { content: none; }
  .google-signin-button { transition: none; }
  .google-signin-button:hover { transform: none; }
}
